#ifndef __COMM_UART_H__
#define __COMM_UART_H__

#include "soft_types.h"

#define COMM_UART_QUEUE                 "/tmp/mq-uart-file"
#define COMM_UART_MAX                   (16)

#define COMM_MULTI_UART

typedef void (*UART_READ_CB_F)(IN UINT8 *, IN UINT16);

typedef struct _UART_CFG_PARAM_s_
{
    INT32  baud_rate;
    INT32  flow_ctrl;
    INT32  data_bits;
    CHAR   parity;
    INT32  stop_bits;
}UART_CFG_PARAM_s;

typedef struct _UART_INIT_PARAM_s_
{
    CHAR *pcPath;
    UART_READ_CB_F pfReadCB;
    UART_CFG_PARAM_s stConfig;
}UART_INIT_PARAM_s;

extern ULONG CommUart_open(IN UART_INIT_PARAM_s stCfg, OUT INT32 *pFd);
extern void CommUart_close(IN INT32 fd);
extern ULONG CommUart_recv(IN INT32 fd, IN INT32 data_len, OUT UINT8 *rcv_buf, OUT INT32 *recvLen);
extern ULONG CommUart_send(IN INT32 fd, IN UINT8 *send_buf, IN INT32 data_len);

#ifdef COMM_MULTI_UART
extern ULONG CommUart_init(void);
extern void CommUart_destory(void);
#endif

#endif //__COMM_UART_H__

